﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Areas/Admin/Views/Shared/AdminSite.Master" Inherits="System.Web.Mvc.ViewPage<List<MensUnoShop.Models.Specification>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	SpecDetail
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

<div id="main-content" class="hastable">
		    <div class="title title-spacing">
			    <h2>規格列表</h2>
					
		    </div>

            <input type="button" value="商品列表" onclick="location.href='/Admin/Product/ProductDetail/<%:ViewData["mkguid"]%>'" />

            <%using (Html.BeginForm("../Product/SpecDetail", "Product", FormMethod.Post, new { @class = "shBox", enctype = "multipart/form-data" }))
            {%>
            <table cellspacing="0">
                <thead> 
                    <tr>
			            <td style="width:100px">規格標籤</td>			
                        <td style="width:300px; text-align: left" align="left" valign="middle">
                            <%if (bool.Parse(TempData["IsAdd"].ToString()))
                              {%>
                                  <%:Html.DropDownList("SPtitletagidList", (IEnumerable<SelectListItem>)ViewData["SPtitletagidList"])%>
                            <%}
                              else
                              {%>
                                  <%:TempData["SPtitle"]%>
                            <%}%>
                            <%:Html.Hidden("Act", TempData["action"])%>
                            <%:Html.Hidden("SPguid", TempData["SPguid"])%>
                            <%:Html.Hidden("SPpdguid", ViewData["SPpdguid"])%>
                        </td>
		            </tr> 
                    <tr>
			            <td style="width:100px">規格庫存</td>
			            <td style="width:300px; text-align: left" align="left" valign="middle"><%:Html.TextBox("SPstock", TempData["SPstock"])%></td>
		            </tr>
                    <tr>
			            <td style="width:100px"></td>
			            <td style="width:300px; text-align: left" align="left" valign="middle"><input type="submit" class="submit" value="<%:TempData["bmsg"] %>" /></td>
		            </tr>
	            </thead>
            </table>
            <%} %>

            <table cellspacing="0">
            <thead>
				<tr>
					<td style="width:100px">規格標籤</td>
					<td style="width:100px">庫存量</td>
                    <td style="width:100px"></td>
				</tr>
			</thead>
            <%if (Model != null){%>
             <tbody>
            <%foreach (var item in Model)
            {  %>
        	    <tr>
                    <td align="center" style="text-align: center" valign="middle"><%:item.TITLE %></td>
                    <td align="center" style="text-align: center" valign="middle"><%:item.STOCK %></td>
                    <td>
                        <%using (Html.BeginForm("SpecDetail", "Product", FormMethod.Post, new { @style = "display:inline" }))
                          {%>
                            <%:Html.Hidden("Act", "ChgStatus")%>
                            <%:Html.Hidden("SPguid", item.SID)%>
                            <%:Html.Hidden("SPpdguid", item.PDGUID)%>
                            <%if (item.SPSTATUS)
                                { %><input type="submit" name="submit" value="上架中" /><%}else{ %><input type="submit" name="submit" value="下架中" /><%} %>
                        <%} %>                
                        <%--<%using (Html.BeginForm("../Product/SpecDetail", "Product", FormMethod.Post, new { @onsubmit="return confirm('確定刪除?');", @style = "display:inline" }))
                          {%>                
                            <%:Html.Hidden("Act", "Del")%>
                            <%:Html.Hidden("SPguid", item.SID)%>
                            <%:Html.Hidden("SPpdguid", item.PDGUID)%>
                            <input type="submit" name="submit" value="刪除" />
                        <%} %>--%>
                        <%using (Html.BeginForm("SpecDetail", "Product", FormMethod.Post, new { @style = "display:inline"}))
                          {%>
                            <%:Html.Hidden("Act", "Upt")%>
                            <%:Html.Hidden("SPguid", item.SID)%>
                            <%:Html.Hidden("SPpdguid", item.PDGUID)%>
                            <input type="submit" name="submit" value="修改" />
                        <%} %>
                    </td>
                </tr>
            <%} %>
            </tbody>
            <%} %>
            </table>
           
            <br/><br/>　
        </div>

</asp:Content>
